package com.itlong.cloud.POJO.PO;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.itlong.cloud.annotation.ItlField;
import com.itlong.cloud.annotation.ItlTables;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;


/**
 *
 *  <desc>
 *      云电梯设备信息表。
 * </desc>
 *
 * @createDate 2017/09/20
 */
@ItlTables("device_elevator_info")
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper=true)
public class DeviceElevatorInfoPO extends BasePO implements Serializable {

    @ItlField(value = "device_unique",logicKey = "key",notNull = "false")
    private String deviceUnique;            //设备全局唯一序列号(项目编号[8位] + 设备类型[1位] + 设备ID[4位])

    @ItlField("device_id")
    private String deviceId;                //设备ID，即设备机号，与设备硬件拨码对应。

    @ItlField("device_name")
    private String deviceName;              //设备名称，一般由客户自定义。

    @ItlField("project_id")
    private String projectId;               //项目编号，由8位数字构成,00000001~99999999.

    @ItlField("floor_no")
    private Integer floorNo;                //电梯服务开始层数

    @ItlField("floor_no_max")
    private Integer floorNoMax;             //电梯服务结束层数

    @ItlField("device_memo")
    private String deviceMemo;              //设备说明

    @ItlField("common_floor")
    private String commonFloor;             //可选公共楼层，由楼层权限标识组成，如1,3,5

    @ItlField("open_threshold")
    private String openThreshold;           //蓝牙开门阈值

    @ItlField("elevator_type")
    private Integer elevatorType;           //电梯类型 11-蓝牙电梯 12-云电梯

    @ItlField("is_bluetooth_elevator")
    private Integer isBluetoothElevator;    //是否配置蓝牙电梯

    @ItlField("device_attributes")
    private Integer deviceAttributes;      //设备属性配置 ：1标准 2云机器人 3全功能

    @ItlField("is_face_recognition")
    private Integer isFaceRecognition;      //是否支持人脸识别 0代表否 1代表是

    @ItlField("is_collect_fees")
    private Integer isCollectFees;          //是否收费 0代表否 1代表是

    @ItlField("sn")
    private String sn;                     //sn,按腾讯要求自定义(项目编号(8) + 预留域（5位，默认为“00000”） + 设备id(3))的16位字符串

    @ItlField("lift_door_type")
    private Integer liftDoorType;          //正背门 0背门 1-正门

    @ItlField("batch_number")
    private String batchNumber;             //批次号


    //阿里IoT设备相关参数
    @ItlField("product_type_id")
    private String productTypeId; //产品型号ID,云电梯产品型号ID
    @ItlField("iot_device_id")
    private String iotDeviceId;   //阿里云颁发的设备id，全局唯一
    @ItlField("iot_device_secret")
    private String iotDeviceSecret; //设备私钥
    @ItlField("iot_device_status")
    private String iotDeviceStatus; //设备状态，目前预留
    @ItlField("iot_device_work_status")
    private  String iotDeviceWorkStatus; //设备工作状态,ONLINE, OFFLINE, UNACTIVE
    @ItlField("token")
    private String token;           //云电梯请求凭证
    @ItlField("equip_mode")
    private Integer equipMode;              // 设备模式，1普通，2收费
    @ItlField("iot_product_id")
    private String iotProductId;              // 设备产品关系表逻辑主键
    @ItlField("floor_num")
    private Integer floorNum;               //外呼控制器绑定真实楼层
    @ItlField("blue_tooth_call_standard")
    private Integer blueToothCallStandard;  //进场呼梯标准开关：1开启 0关闭
    @JsonIgnore
    private String unitId;           //单元编号
    @JsonIgnore
    private String elevatorDeviceUniques;

    public DeviceElevatorInfoPO(String deviceUnique, String deviceName, String projectId, Integer floorNo, Integer floorNoMax, String deviceId) {
        this.deviceUnique = deviceUnique;
        this.deviceName = deviceName;
        this.projectId = projectId;
        this.floorNo = floorNo;
        this.floorNoMax = floorNoMax;
        this.deviceId = deviceId;
    }

    public DeviceElevatorInfoPO(String deviceUnique) {
        this.deviceUnique = deviceUnique;
    }
}